package utils

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

func ErrHandle(c *gin.Context) {
	if r := recover(); r != nil {
		fmt.Println("recovered from ", r)
		c.JSON(http.StatusOK, SetPackageData(500, nil))
		c.Abort()
	}

}
